package com.zhongkai.model3;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

@Entity
@Table(name = "fson_user",    catalog = "")
public class FsonUser implements Serializable {
    private Integer id;
    private String fUid; //该用户可操控的设备的设备uuid
    private String appPhone; //可控制设备的用户手机号
    private String fatherPhone;//父用户手机号如果是户主用户存入0
    private Integer appRole;//角色id
    private String appUuid;//可操控设备用户的唯一标识
    private String fUuid;//父用户的唯一标识户主存入0
    private String setAlias;//设备别名
    private Integer Uuid;
    private String role;
    private String sonName;

    public SetUnit setUnit;

    @Basic
    @Column(name = "son_name")
    public String getSonName() {
        return sonName;
    }

    public void setSonName(String sonName) {
        this.sonName = sonName;
    }


    @Basic
    @Column(name = "u_uid")
    public Integer getUuid() {
        return Uuid;
    }

    public void setUuid(Integer uuid) {
        Uuid = uuid;
    }


    @Basic
    @Column(name = "role")
    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    @Basic
    @Column(name = "set_alias")
    public String getSetAlias() {
        return setAlias;
    }

    public void setSetAlias(String setAlias) {
        this.setAlias = setAlias;
    }

    @Id
    @GenericGenerator(name = "generator", strategy = "increment")
    @GeneratedValue(generator = "generator")
    @Column(name = "id")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "f_uid")
    public String getfUid() {
        return fUid;
    }

    public void setfUid(String fUid) {
        this.fUid = fUid;
    }

    @Basic
    @Column(name = "app_phone")
    public String getAppPhone() {
        return appPhone;
    }

    public void setAppPhone(String appPhone) {
        this.appPhone = appPhone;
    }

    @Basic
    @Column(name = "father_phone")
    public String getFatherPhone() {
        return fatherPhone;
    }

    public void setFatherPhone(String fatherPhone) {
        this.fatherPhone = fatherPhone;
    }

    @Basic
    @Column(name = "app_role")
    public Integer getAppRole() {
        return appRole;
    }

    public void setAppRole(Integer appRole) {
        this.appRole = appRole;
    }

    @Basic
    @Column(name = "app_uuid")
    public String getAppUuid() {
        return appUuid;
    }

    public void setAppUuid(String appUuid) {
        this.appUuid = appUuid;
    }

    @Basic
    @Column(name = "f_uuid")
    public String getfUuid() {
        return fUuid;
    }

    public void setfUuid(String fUuid) {
        this.fUuid = fUuid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        FsonUser fsonUser = (FsonUser) o;
        return Objects.equals(id, fsonUser.id) &&
                Objects.equals(fUid, fsonUser.fUid) &&
                Objects.equals(appPhone, fsonUser.appPhone) &&
                Objects.equals(fatherPhone, fsonUser.fatherPhone) &&
                Objects.equals(appRole, fsonUser.appRole) &&
                Objects.equals(appUuid, fsonUser.appUuid) &&
                Objects.equals(fUuid, fsonUser.fUuid);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, fUid, appPhone, fatherPhone, appRole, appUuid, fUuid);
    }
}
